package com.sise.thread.buyorder;

/**
 * 作者：idea
 * 日期：2018/6/4
 * 描述：
 */
public class test {
    public static void main(String[] args) throws InterruptedException {
        //为了模拟有两个窗口在抢票
        ThreadTrain2 buyorder=new ThreadTrain2();
        Thread t1= new Thread(buyorder,"窗口1");
        Thread t2= new Thread(buyorder,"窗口2");
        t1.start();
        Thread.sleep(40);
        buyorder.flag=false;
        t2.start();

//        ThreadTrain2 threadTrain2=new ThreadTrain2();
//        Thread t1= new Thread(threadTrain2,"窗口1");
//        Thread t2= new Thread(threadTrain2,"窗口2");
//        t1.start();
//        Thread.sleep(40);
//        threadTrain2.flag=false;
//        t2.start();
    }
}
